package cn.wmm.company.facade.model;

import cn.wmm.company.facade.enums.UserResultEnum;

import java.io.Serializable;

/**
 * @author zhengzihong
 * @version 1.1.1
 * @date 2018/3/2
 * @description 封装dubbo接口返回参数
 */
public class UserResultBean<T> implements Serializable {

    private static final long serialVersionUID = 4065747140425735061L;

    /**
     * 返回话术
     */
    private String resultDesc;

    /**
     * 返回码
     */
    private String resultCode;

    /**
     * 返回结果
     */
    private T result;


    public UserResultBean() {
    }


    public UserResultBean(String resultDesc, String resultCode, T result) {
        this.resultDesc = resultDesc;
        this.resultCode = resultCode;
        this.result = result;
    }

    public UserResultBean(String resultDesc, String resultCode) {
        this.resultDesc = resultDesc;
        this.resultCode = resultCode;
    }


    public UserResultBean(UserResultEnum userResultEnum, T result) {
        this.resultDesc = userResultEnum.getResultDesc();
        this.resultCode = userResultEnum.getResultCode();
        this.result = result;
    }


    public UserResultBean setUserResultBean(UserResultEnum userResultEnum, T result){
        this.resultDesc = userResultEnum.getResultDesc();
        this.resultCode = userResultEnum.getResultCode();
        this.result = result;
        return this;
    }


    public String getResultDesc() {
        return resultDesc;
    }

    public void setResultDesc(String resultDesc) {
        this.resultDesc = resultDesc;
    }

    public String getResultCode() {
        return resultCode;
    }

    public void setResultCode(String resultCode) {
        this.resultCode = resultCode;
    }

    public T getResult() {
        return result;
    }

    public void setResult(T result) {
        this.result = result;
    }
}
